<?php
	$frm_oghtinrao = $this->frmOghTinRao;
?>

<div class="block">
	<div class="title">
		<span>Chỉnh sửa tin ở ghép</span>
	</div>
	<div class="content">
		<?php echo '<form id="' . $frm_oghtinrao->getId() . '" method="' . $frm_oghtinrao->getMethod() . '" action="" enctype="' . $frm_oghtinrao->getEnctype() . '" name="' . $frm_oghtinrao->getName() . '">'; ?>
		<div class="frm-info">
			<script type="text/javascript">
				$(document).ready(function() {
					var imgUrl = '<?php echo $this->baseUrl(PUBLIC_IMG_URL . "/tmp"); ?>';
					$('#thumbnail').attr("src", '<?php echo $this->baseUrl(PUBLIC_IMG_URL . '/phong_tro/avatar/avatar_home.png'); ?>');
						
				  	$('#inputupload').uploadify({
				    	'swf'  				: '<?php echo $this->baseUrl(PUBLIC_PATH . "/scripts/uploadify/uploadify.swf");?>',
				    	'uploader'    		: '<?php echo $this->baseUrl($this->currentController . '/uploadavatar'); ?>',
					    'buttonImage' 		: '<?php echo $this->baseUrl(PUBLIC_PATH . "/scripts/uploadify/browse-btn.png"); ?>',
					    'uploadFolder' 		: '<?php echo $this->baseUrl(PUBLIC_IMG_URL . "/tmp"); ?>',
				        'multi'     		: false,
				        'auto'      		: true,
				        'fileTypeDesc' 		: 'Image Files',
				        'fileTypeExts' 		: '*.gif; *.jpg; *.jpeg; *.png', 
				        'onUploadStart'		: function(file) {
				        	fileName = $('#hidden_hinh_anh').val();
				        	if (fileName != '') {
				        		$.ajax({
				    				'url' 	: '/member/deleteimage',
				    				'type' 	: 'post',
				    				'data' 	: {'imgUrl' : 'thumb_images_64x64', 'filename' : fileName}
				    			});
				        	}
				        },
			        	'onUploadSuccess' 	: function(file, data, response) {
			        		img = imgUrl + "/thumb_images_64x64/" + data;
				        	$('#thumbnail').attr("src", img);
				        	$('#hidden_hinh_anh').val(data);
				        	$('#hinh_anh').val(file.name);
			         	}
					});
				});
			</script>
			<?php 
				$html = $frm_oghtinrao->tieu_de;
				$html .= $frm_oghtinrao->dia_chi;
				$html .= $frm_oghtinrao->thanh_pho;
				$html .= $frm_oghtinrao->quan_huyen;
				$html .= $frm_oghtinrao->hinh_anh;
				$html .= $frm_oghtinrao->gioi_tinh;
				$html .= $frm_oghtinrao->loai_phong;
				$html .= $frm_oghtinrao->so_nguoi_o;
				$html .= $frm_oghtinrao->dien_tich_phong;
				$html .= $frm_oghtinrao->gia_o_ghep;
				$html .= $frm_oghtinrao->loai_tin;
				$html .= $frm_oghtinrao->mo_ta;
				echo $html;
			?>
			<div class="line-break"></div>
			<p class="head-contact">Thông tin liên hệ</p>
			<div class="contact-info">
				<?php
					$html = $frm_oghtinrao->nguoi_lien_he; 
					$html .= $frm_oghtinrao->so_dien_thoai;
					echo $html;
				?>
			</div>
		</div>
		<div class="frm-button">
			<?php echo $frm_oghtinrao->buttons; ?>
			<div class="clear"></div>
		</div>
		<?php echo '</form>'?>
	</div>
	<br class="clear" />
</div>